package org.example.controller;

import org.example.service.EmailService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/api/email")
public class EmailController {

    private final EmailService emailService;

    public EmailController(EmailService emailService) {
        this.emailService = emailService;
    }

    // 发送简单邮件
    @PostMapping("/simple")
    public String sendSimple() {
        emailService.sendSimpleEmail(
                "3082311852@qq.com",
                "测试邮件主题",
                "这是一封纯文本测试邮件"
        );
        return "简单邮件已发送";
    }

}